<?php 
include_once $_SERVER["DOCUMENT_ROOT"] . "/functions/bdd/messages/sources.php"; 
include_once $_SERVER["DOCUMENT_ROOT"] . "/functions/bdd/messages/description.php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/functions/parser/parse.php"; 

if (isset($_POST['sources'])) {
	header("location: index.php");
	$sources = parse($_POST['sources']);
	set_sources($sources);
} else {
	?>

	<!DOCTYPE html>
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >

		<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/header.php"); ?>

		<body>
			<div id	 = "corps">

				<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/entete.php"); ?>
				<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/form_recherche.php"); ?>
				<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/menu.php"); ?>	

				<div id="presentation">
					<p>
						<?php echo get_description() ?>
					</p>
				</div>

				<hr style="clear: both"/>

				<div class="underline">
					<h2>Sources</h2>
					<form method="POST" action="modif_sources.php">
						<p>
							<textarea rows="30" cols="80" name="sources"><?php echo get_sources() ?></textarea><br/>
							<input type="submit" />
						</p>
					</form>
				</div>
				<?php //include_once("footer.php"); ?>
			</div>
		</body>
	</html>
	<?php
}
?>